//
// Project Kimchi
//
// Copyright IBM Corp, 2015-2017
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#storage-root-container {
    .wok-datagrid-body {
        span > .fa {
            font-size: 22px;
            width: 20px;
            height: 20px;
            position: relative;
        }
        .handle {
            -webkit-user-select: none;
            -moz-user-select: none;
            user-select: none;
            position: relative;
        }
        .active {
            .handle {
                cursor: pointer;
            }
            .fa-power-off {
                color: $fa-green;
            }
        }
        .inactive {
            .handle {
                cursor: default;
            }
            .fa-power-off {
                display: none;
            }
            .usage-icon.icon-high {
                background-image: url('../../#{$wok-icon-path}/high_disabled.png') !important;
            }
            .usage-icon.icon-med {
                background-image: url('../../#{$wok-icon-path}/med_disabled.png') !important;
            }
            .usage-icon.icon-low {
                background-image: url('../../#{$wok-icon-path}/low_disabled.png') !important;
            }
        }
    }
    .volumes {
        width: 100%;
        background: $navbar-default-toggle-hover-bg;
        display: none;

        .tooltip > .tooltip-inner {
            width: 150px;
        }

        input[type=checkbox][disabled].wok-checkbox + label:before {
            content: '';
        }

        .toggle-gallery {
            left: 202px;
            @media (min-width: $screen-lg) {
                left: 282px;
            }
        }

        > .footer {
            z-index: 100;
        }

        .volumeslist {
            padding: 22px;
            min-height: 188px;
            max-height: 505px;
            overflow: hidden;
        }

        .volumeslist .wok-list {
            min-height: inherit;
        }

        .volumeslist .row {
            font-size: 0;
            margin-bottom: 22px;
        }

        .volumeslist .filter {
            width: 344px;
            height: 38px;
            margin-top: 1px;
            @media (min-width: $screen-md) {
                width: 514px;
            }
        }

        .pool-action {
            display: inline-block;
            margin-right: 20px;
        }

        .volume-icon {
            display: inline-block;
            vertical-align: middle;
            width: 27px;
            height: 27px;
            line-height: 27px;
            background-repeat: no-repeat;
            background-position: 50%;
            background-color: transparent;
        }

        .volume-icon.icon-high {
            background-image: url('../../#{$wok-icon-path}/high.png');
        }
        .volume-icon.icon-med {
            background-image: url('../../#{$wok-icon-path}/med.png');
        }
        .volume-icon.icon-low {
            background-image: url('../../#{$wok-icon-path}/low.png');
        }

        .volume-progress {
            position: absolute;
            margin: 0;
            width: 407px;
            top: 4px;
            left: 4px;

            .progress-bar-outer {
                background: $table-bg-hover;
                height: 6px;
                overflow: hidden;
                width: 100%;
            }
            .progress-bar-inner {
                background: $storages-low;
                height: 100%;
                width: 100%;
            }
        }

        .volume-data {
            margin: 0;
            padding: 0;
            list-style: none;
            > li {
                display: inline-block;
                width: 89px;
                span {
                    display: block;
                    font-size: 12pt;
                }
                span.value {
                    font-weight: 600;
                }
                span.key {
                    font-weight: 300;
                }
            }
        }
        .pool-empty{
            width: 100%;
            cursor: default !important;
            > span  {
            width: 100%;
            text-align: center;
            line-height: 136px;
            vertical-align: middle !important;
            }
        }

    .wok-gallery {

        &.wok-datagrid {
            background: transparent;
            margin-top: -12px;
        }

        &.wok-datagrid > .wok-datagrid-header {
            display: none;
        }

        &.wok-datagrid > .wok-datagrid-body {
            margin-left: -3px;
            overflow-y: auto;
            overflow-x: hidden;
            max-height: 400px;
        }

        &.wok-datagrid .wok-datagrid-body > .wok-datagrid-row {
            position: relative;
            cursor: pointer;
            background: $body-bg !important;
            border: 0 !important;
            display: inline-block !important;
            width: 415px !important;
            margin: 12px 4px 0;
            &, * {
                -webkit-user-select: none;
                -moz-user-select: none;
                user-select: none;
            }
        }

        &.wok-datagrid .wok-datagrid-body > .wok-datagrid-row.selected .volume-box-border {
            border-color: $virtColor;
            border-color: rgba($virtColor,1);
        }

        &.wok-datagrid .wok-datagrid-body > .wok-datagrid-row.selected .volume-box-inner {
            border-color: $gray-base;
        }

        .volume-box-outer {
            border-radius: 3px;
            overflow: hidden;
        }

        .volume-box-border {
            display: block;
            border-width: 3px;
            border-style: solid;
            border-color: transparent;
            border-color: rgba(255,255,255,0);
            transition: border-color .1s ease-in-out
        }

        .volume-box-inner {
            padding: 0 16px;
            width: 409px;
            height: auto;
            display: flex;
            flex-flow: row wrap;
            justify-content: space-around;
            border-width: 1px;
            border-style: solid;
            border-color: #fff;
            background: #fff;
            transition: border-color .1s ease-in-out;
        }

        span.column-name,
        span.column-used {
            height: 52px;
            line-height: 52px;
            border-bottom: 1px solid $input-border;
            }

        span.column-name {
            width: 282px;
            order: 1;
        }

        span.column-used {
            width: 93px;
            order: 2;
        }

        span.column-used-by {
            width: 20px;
            height: 20px;
            order: 3;
            position: absolute;
            right: 22px;
            top: 20px;

            .fa {
                display: block;
                color: #424242;
            }

            .format-text {
                display: none !important;
            }

        }

        span.column-name label.volume-name {
            width: 100%;
            height: 52px;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            display: block;
            margin: 0;
            padding-right: 6px;
        }

        span.column-allocated,
        span.column-capacity,
        span.column-format,
        span.column-type {
            order: 3;
            width: auto;
            margin: 5px 0px;
        }

        span.gallery-header {
            font-weight: 600;
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 90px;
        }

        span.column-progress {
            display: none;
        }

        .tooltip-iner {
            font-size: 11pt;
            padding: 6px 12px;
        }

    }

    .wok-list {

        span.gallery-header {
            display: none;
        }

        .volume-inline-progress {
            vertical-align: middle;
            display: inline-block;
            margin-right: 7px;
        }

        .volume-inline-progress > i.wok-loading-icon {
            margin-right: 0;
        }

        .volume-progress, .volume-progress *  {
            display: none !important;
        }

        .volume-box-inner {
            font-size: 0;
        }

        &.wok-datagrid > .wok-datagrid-header {

            > span.column-name {
                padding-left: 41px;
            }

        }

        &.wok-datagrid > .wok-datagrid-body {
            overflow-y: auto;
            overflow-x: hidden;
            max-height: 350px;
        }

        &.wok-datagrid > .wok-datagrid-body > .wok-datagrid-row {
            position: relative;
            cursor: pointer;

            .volume-box-border {
                border-color: rgba(255,255,255,0);
                border-width: 0px;
                border-style: solid;
            }

            .volume-box-inner {
                border-color: rgba(255,255,255,0);
                border-width: 0px;
                border-style: solid;
            }

        }

        &.wok-datagrid > .wok-datagrid-body > .wok-datagrid-row.selected {
            background: $table-bg-hover !important;
        }

        &.wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > div > div > div {

            > span {
                font-family: $font-family-sans-serif;
                line-height: (1 + $line-height-base);
                vertical-align: top;
                font-size: 12.5pt;
                font-weight: 400;
            }

            > span.column-name {
                padding-left: 15px;
            }

        }

        &.wok-datagrid > .wok-datagrid-header,
        &.wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > div > div > div {

            >span {
                display: inline-block;
                vertical-align: middle;
            }

            > span.column-format {
                width: 57px;
                @media (min-width: $screen-md) {
                    width: 127px;
                }
                @media (min-width: $screen-lg) {
                    left: 173px;
                }
            }

            > span.column-used,
            > span.column-type,
            > span.column-capacity,
            > span.column-allocated,
            > span.column-progress {
                width: 79px;
                text-transform: capitalize;
                @media (min-width: $screen-md) {
                    width: 142px;
                }
                @media (min-width: $screen-lg) {
                    left: 165px;
                }
            }

            > span.column-used-by {
                width: 69px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                padding-right: 5px;
                @media (min-width: $screen-md) {
                    width: 85px;
                }
                @media (min-width: $screen-lg) {
                    width: 155px;
                }

                .fa {
                    display: none !important;
                }
            }

            > span.column-name {
                width: 202px;
                @media (min-width: $screen-md) {
                    width: 450px;
                }
                @media (min-width: $screen-lg) {
                    width: 500px;
                }

                label {
                    padding: 0 5px 0 0;
                    margin-right: 0;
                    margin-bottom: 0;
                    font-size: inherit;
                    font-weight: inherit;
                    width: 100%;
                    display: block;
                    height: auto;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
            }

            > span.column-progress {
                white-space: nowrap;
            }
        }

    }


    }
    .wok-datagrid > .wok-datagrid-body > .wok-datagrid-row[data-stat="inactive"] {
        color: $gray-light !important;
    }
    .wok-datagrid > .wok-datagrid-header,
    .wok-datagrid > .wok-datagrid-body > .wok-datagrid-row {
        > span.column-state {
            width: 2.0519%;
            text-align: center;
        }
        > span.column-name {
            width: 126px;
            text-overflow: ellipsis;
            display: inline-block;
            white-space: nowrap;
            overflow: hidden !important;
        }
        > span.column-type {
            width: 101px;
            text-overflow: ellipsis;
            display: inline-block;
            white-space: nowrap;
            overflow: hidden !important;
        }
        > span.column-location {
            width: 171px;
            text-overflow: ellipsis;
            display: inline-block;
            white-space: nowrap;
            overflow: hidden !important;
        }
        > span.column-usage {
            width: 152px;
            text-overflow: ellipsis;
            display: inline-block;
            white-space: nowrap;
            overflow: hidden !important;
            .usage-icon {
                padding-left: 35px;
                display: inline-block;
                background-repeat: no-repeat;
                background-position: 0 50%;
                background-color: transparent;
                &.icon-high {
                    background-image: url('../../#{$wok-icon-path}/high.png');
                }
                &.icon-med {
                    background-image: url('../../#{$wok-icon-path}/med.png');
                }
                &.icon-low {
                    background-image: url('../../#{$wok-icon-path}/low.png');
                }
            }
        }
        > span.column-capacity {
            width: 129px;
            text-overflow: ellipsis;
            display: inline-block;
            white-space: nowrap;
            overflow: hidden !important;
        }
        > span.column-allocated {
            width: 134px;
            text-overflow: ellipsis;
            display: inline-block;
            white-space: nowrap;
            overflow: hidden !important;
        }
        > span.column-disks {
            text-align: center;
            width: 105px;
            text-overflow: ellipsis;
            display: inline-block;
            white-space: nowrap;
            overflow: hidden !important;
        }
        > span.column-action {
            width: 254px;
            text-align: right;
        }
    }
    .wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span {
        &.column-state {
            height: 53px;
            vertical-align: middle;
        }
        &.column-disks {
            height: 53px;
            vertical-align: middle;
            .arrow-down,
            .arrow-up {
                display: inline-block;
                font: normal normal normal 14px/1 FontAwesome;
                font-size: inherit;
                text-rendering: auto;
                -webkit-font-smoothing: antialiased;
                -moz-osx-font-smoothing: grayscale;
            }
            .arrow-down:before {
                content: "\f078";
            }
            .arrow-up:before {
                content: "\f077";
            }
        }
    }
}

#storage-root-container #logicalPoolExtend {
    .modal-body {
        max-height: 438px;
        p span {
            vertical-align: middle !important;
        }
    }
}

#storage-root-container #logicalPoolExtend,
.storage-modal {
    form {
        margin: 0 !important;
    }
    .host-partition {
        overflow-y: auto;
        overflow-x: hidden;
        max-height: 430px;
        label {
            display: block;
            > div {
                vertical-align: top;
                display: inline-block;
            }
            span.device-name,
            span.device-path {
                display: block;
            }
            span.device-name {
                font-weight: 600;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            span.device-path {
                font-weight: 400;
                word-wrap: break-word;
            }
        }
    }
}

#storage-root-container #logicalPoolExtend {
    .host-partition label > div {
        width: 388px;
        span.device-path {
            width: 388px;
        }
    }
}

.storage-modal {
    // Wok Popable
    .filter-select.popable,
    .storage-target-input,
    .storage-add-input {
        .popover {
            max-width: 100% !important;
            width: 100%;
            top: 34px;
            left: -2px;
            border: 0 !important;
            background: 0 !important;
            box-shadow: none !important;
            ul {
                z-index: $zindex-dropdown;
                padding: 5px 0;
                margin: 2px 2px 0;
                list-style: none;
                font-size: $font-size-base;
                text-align: left;
                background-color: $dropdown-bg;
                border: 1px solid $dropdown-fallback-border;
                border: 1px solid $dropdown-border;
                border-radius: $border-radius-base;
                -webkit-box-shadow: compact(0 6px 12px rgba(0, 0, 0, 0.175));
                -moz-box-shadow: compact(0 6px 12px rgba(0, 0, 0, 0.175));
                box-shadow: compact(0 6px 12px rgba(0, 0, 0, 0.175));
                background-clip: padding-box;
                li {
                    cursor: pointer;
                    display: block;
                    padding: 3px 20px;
                    clear: both;
                    font-weight: normal;
                    line-height: $line-height-base;
                    color: $dropdown-link-color;
                    white-space: nowrap;
                    &:hover,
                    &:focus {
                        text-decoration: none;
                        color: $dropdown-link-hover-color;
                        background-color: $dropdown-link-hover-bg;
                    }
                }
            }
        }
    }
    #nfspathId[style],
    #nfsserverId[style] {
        // overriding style definition
        width: 100% !important;
    }
    .iscsi-section .form-group > .col-md-12 > .col-md-10 + .col-md-2 {
        padding-left: 5px;
    }
    .iscsi-section .form-group > .col-md-12 > .col-md-10 {
        padding-right: 5px;
    }
    .authenticationfield > div > .col-md-6 + .col-md-6 {
        padding-left: 5px;
    }
    .authenticationfield > div > .col-md-6 {
        padding-right: 5px;
    }
    .host-partition label > div {
        width: 688px;
        span.device-path {
            width: 688px;
        }
    }
}
